﻿// JScript 文件
var enumPORT_RC_ROWCOL = 1;	    //先行后列
var enumPORT_RC_COLROW = 2;	    //先列后行

var enumPORT_UD_UPDOWN = 1;	    //从上到下
var enumPORT_UD_DOWNUP = 2;	    //从下到上

var enumPORT_LR_LEFTRIGHT = 1;	//从左到右
var enumPORT_LR_RIGHTLEFT = 2;	//从右到左

var DEFAULT_KH = "";

var enumPORT_STATE_IDLE = 0;
var enumPORT_STATE_USED = 1;
var enumPORT_STATE_PREUSE = 2;
var enumPORT_STATE_RESERVE = 3;
var enumPORT_STATE_BAD = 4;
var enumPORT_STATE_OTHER = 5;

var enumPORT_LAY_UPTODOWN      = 	1;	//从上到下   2
var enumPORT_LAY_DOWNTOUP      =	2;	//从下到上   4
var enumPORT_LAY_LEFTTORIGHT   =    4;	//从左到右   6
var enumPORT_LAY_RIGHTTOLEFT   =    3;	//从右到左   5
var enumPORT_LAY_INNERTOOUTER  =	0;	//从里到外   1 无
var enumPORT_LAY_OUTERTOINNER  =	0;	//从外到里   3 无

//设备端子信息，唯一标识一个端子
function GJSB_DZ()
{
    this.DevBm = "";    //设备编码
    this.Kh = "";       //端子框号
    this.Dzh = "";      //端子号

}

function GJSB_DZ_POS()			//端子位置
{
	this.MkHh = 0;				//模块行号(对于ODF是物理框号)
	this.MkLh = 1;				//模块列号(对于ODF为1)
	this.Row = 0;				//端子物理行号
	this.Line = 0;				//端子物理列号
}

function GJSB_DZ_INFO()
{
    this.Dz = new GJSB_DZ();    //    类型为GJSB_DZ
    this.DzPos = new GJSB_DZ_POS();
    this.State = 0;
    this.Bz = "";
}

//光缆段纤芯信息

function GLD_QX()
{
    this.GldBm = "";//光缆段编码

    this.Qxh = 0;//纤芯序号
}

//端子关联光路信息
function GJSB_DZ_GR()
{
    this.Dz = new GJSB_DZ();//端子信息,类型为GJSB_DZ
    this.GrBm = "";//光路编码
}

//端子关联局向光纤信息

function GJSB_DZ_JXGQ()
{
    this.Dz = new GJSB_DZ();//端子信息，类型为GJSB_DZ
    this.JxgqBm = "";//局向光纤编码

}

//端子关联跳接信息
function GJSB_DZ_JUMP()
{
    this.RdDz = new GJSB_DZ();//入端端子信息，类型为GJSB_DZ
    this.CdDz = new GJSB_DZ();//出端端子信息，类型为GJSB_DZ
}

//端子关联成端信息
function GJSB_DZ_CD()
{
    this.CdDz = new GJSB_DZ();  //端子信息，类型为GJSB_DZ
    this.CdQx = new GLD_QX(); //纤芯信息，类型为GLD_QX
}

function DZMB_INFO_ODF() //ODF端子面板信息
{
    this.Ls = 1;                //列数
    this.LMks = 0;              //块数
    this.LPlfs = 0;             //列排列方式
    this.KPlfs = 0;              //块排列方式

    this.listOdmInfo = null;    //该ODF中所有的ODM信息,类型为Array
}

function DZMB_INFO_NOT_ODF() //非ODF的光交设备端子面板信息
{
    this.Ls = 0;                //列数
    this.LMks = 0;              //块数
    this.LPlfs = 0;             //列排列方式
    this.KPlf = 0;              //块排列方式
    this.listDzb = null;         //该光交设备中所有端子板信息,类型为Array
}

function ODM_INFO()			//ODM信息
{
    this.EntityNo = 0;			//实体号
    this.WlKh = 0;				//物理框号
    this.Kh = "";			    //框号
    this.iDys = 0;				//单元数
    this.iMdybs = 0;			//每单元板数
    this.iMbdzs = 0;			//每板端子数
    this.Dyplfs = 0;			//单元排列方式
    this.Bplfs = 0;				//板排列方式
    this.Dzplfs = 0;			//端子排列方式
    this.Bz = "";			       //备注
}

function GJSBDZ_BLOCK()			//端子块信息
{
    this.EntityNo = 0;			//实体号
    this.MkLh = 0;				//模块列号
    this.MkHh = 0;				//模块行号
    this.RowPerBlock = 0;		//每块行数
    this.LinePerBlock = 0;		//每块列数
    this.Dzhplfs = 0;			//端子行的排列方式(从上到下/从下到上)
    this.Dzlplfs = 0;			//端子列的排列方式(从左到右/从右到左)
    this.RowFirst = 0;			//行优先/列优先
}

function GjsbMbGlInfo(gjsbBm)
{
    //属性
    this.m_iMaxRowPerBlock = 0;
    this.m_iMaxLinePerBlock = 0;
    this.listCdInfo = new Array();
    this.listCdInfo2 = new Array();
    this.listTjInfo = new Array();
    this.listJxgqInfo = new Array();
    this.listJxgqInfo2 = new Array();
    this.listGrInfo = new Array();
    this.listDzInfo = new Array();
    this.listDzInfoSortByPos = new Array();
    this.gjsbBm = gjsbBm;
    
    this.OdfDzMbInfo = new DZMB_INFO_ODF();
    this.GjsbDzMbInfo = new DZMB_INFO_NOT_ODF();
    
    //方法
    this.setDzCdInfo = setDzCdInfo;
    this.setDzTjInfo = setDzTjInfo;
    this.setDzJxgqInfo = setDzJxgqInfo;
    this.setDzGrInfo = setDzGrInfo;
    this.setDzInfo = setDzInfo;
  
    this.GetOdmHls = GetOdmHls;
    this.setGjsbMbInfo   = setGjsbMbInfo;
    this.setOdfMbInfo = setOdfMbInfo;
    this.GetOdmByWlkh = GetOdmByWlkh;
    this.GetBlockByMkHhLh = GetBlockByMkHhLh;
    this.GetDzInfoByPos = GetDzInfoByPos;
    
    this.getDzGlCdInfo = getDzGlCdInfo;
    this.getDzGlTjInfo = getDzGlTjInfo;
    this.getDzGlJxgqInfo = getDzGlJxgqInfo;
    this.getDzGlGrInfo = getDzGlGrInfo;
    this.getDzInfo = getDzInfo;
    this.GetMaxRowPerBlock = GetMaxRowPerBlock;
    this.GetMaxLinePerBlock = GetMaxLinePerBlock;
}

function setDzCdInfo(xmlGjsbCdInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlGjsbCdInfo);
    
	var DzCdInfos = XmlDoc.getElementsByTagName("ITEM");
	for(var i = 0; i < DzCdInfos.length; i++)
	{
	    var DzCd = new GJSB_DZ_CD();
	    
        DzCd.CdQx.GldBm = DzCdInfos[i].getAttribute("GLDBM");
        DzCd.CdQx.Qxh = parseInt(DzCdInfos[i].getAttribute("QXH"));
        DzCd.CdDz.Kh = DzCdInfos[i].getAttribute("KH");		
        DzCd.CdDz.Dzh = DzCdInfos[i].getAttribute("DZH");		
   
        //如果该块号对应的数组不存在，创建
        if(this.listCdInfo[DzCd.CdDz.Kh] == null)
        {
            this.listCdInfo[DzCd.CdDz.Kh] = new Array();
            this.listCdInfo[DzCd.CdDz.Kh][DzCd.CdDz.Dzh] = DzCd;
            continue;
        }
        
        //如果该端子上已经有一个成端信息，把第二个成端添加到另外的列表中
        if(this.listCdInfo[DzCd.CdDz.Kh][DzCd.CdDz.Dzh] != null)
        {
            if(this.listCdInfo2[DzCd.CdDz.Kh] == null)
            {
                this.listCdInfo2[DzCd.CdDz.Kh] = new Array();
            }
            this.listCdInfo2[DzCd.CdDz.Kh][DzCd.CdDz.Dzh] = DzCd
        }
        else
        {
	        this.listCdInfo[DzCd.CdDz.Kh][DzCd.CdDz.Dzh] = DzCd;
	    }
	}
}

function setDzGrInfo(xmlGjsbGrInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlGjsbGrInfo);
    
	var DzGrInfos = XmlDoc.getElementsByTagName("ITEM");
	for(var i = 0; i < DzGrInfos.length; i++)
	{
	    var DzGr = new GJSB_DZ_GR();
	    
        DzGr.GrBm = DzGrInfos[i].getAttribute("GRBM");
        DzGr.Dz.Kh = DzGrInfos[i].getAttribute("KH");		
        DzGr.Dz.Dzh = DzGrInfos[i].getAttribute("DZH");		
   
        if(this.listGrInfo[DzGr.Dz.Kh] == null)
        {
            this.listGrInfo[DzGr.Dz.Kh] = new Array();
        }
        
	    this.listGrInfo[DzGr.Dz.Kh][DzGr.Dz.Dzh] = DzGr;
	}
}

function setDzJxgqInfo(xmlGjsbJxgqInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlGjsbJxgqInfo);
    
	var DzJxgqInfos = XmlDoc.getElementsByTagName("ITEM");
	for(var i = 0; i < DzJxgqInfos.length; i++)
	{
	    var DzJxgq = new GJSB_DZ_JXGQ();
	    
        DzJxgq.JxgqBm = DzJxgqInfos[i].getAttribute("JXGQBM");
        DzJxgq.Dz.Kh = DzJxgqInfos[i].getAttribute("KH");		
        DzJxgq.Dz.Dzh = DzJxgqInfos[i].getAttribute("DZH");		
   
        //如果该框的信息还没有，创建一个新的列表

        if(this.listJxgqInfo[DzJxgq.Dz.Kh] == null)
        {
            this.listJxgqInfo[DzJxgq.Dz.Kh] = new Array();
            this.listJxgqInfo[DzJxgq.Dz.Kh][DzJxgq.Dz.Dzh] = DzJxgq;
            continue;
        }
        //如果该端子上已经有一个局向光纤信息，把第二个局向光纤添加到另外的列表中
        if(this.listJxgqInfo[DzJxgq.Dz.Kh][DzJxgq.Dz.Dzh] != null)
        {
            if(this.listJxgqInfo2[DzJxgq.Dz.Kh] == null)
            {
                this.listJxgqInfo2[DzJxgq.Dz.Kh] = new Array();
            }
            this.listJxgqInfo2[DzJxgq.Dz.Kh][DzJxgq.Dz.Dzh] = DzJxgq;
        }
        else
        {
	        this.listJxgqInfo[DzJxgq.Dz.Kh][DzJxgq.Dz.Dzh] = DzJxgq;
	    }
	}
}

function setDzTjInfo(xmlGjsbTjInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlGjsbTjInfo);
    
	var DzTjInfos = XmlDoc.getElementsByTagName("ITEM");
	for(var i = 0; i < DzTjInfos.length; i++)
	{
	    var DzTj = new GJSB_DZ_JUMP();
	    
	    DzTj.RdDz.DevBm = DzTjInfos[i].getAttribute("RDDEVBM");
        DzTj.RdDz.Kh = DzTjInfos[i].getAttribute("RDKH");
        DzTj.RdDz.Dzh = DzTjInfos[i].getAttribute("RDDZH");	
        DzTj.CdDz.DevBm = DzTjInfos[i].getAttribute("CDDEVBM");	
        DzTj.CdDz.Kh = DzTjInfos[i].getAttribute("CDKH");		
        DzTj.CdDz.Dzh = DzTjInfos[i].getAttribute("CDDZH");
        
        //如果入端设备编码为空或者等于该光交设备编码，表示入端端子在本光交设备上
        if(DzTj.RdDz.DevBm == null || DzTj.RdDz.DevBm == this.gjsbBm)
        {
            if(this.listTjInfo[DzTj.RdDz.Kh] == null)
            {
                this.listTjInfo[DzTj.RdDz.Kh] = new Array();
            }
            this.listTjInfo[DzTj.RdDz.Kh][DzTj.RdDz.Dzh] = DzTj;
        }
        //如果出端设备编码为空或者等于该光交设备编码，表示出端端子在本光交设备上
        if(DzTj.CdDz.DevBm == null|| DzTj.CdDz.DevBm == this.gjsbBm)
        {
            if(this.listTjInfo[DzTj.CdDz.Kh] == null)
            {
                this.listTjInfo[DzTj.CdDz.Kh] = new Array();
            }
            this.listTjInfo[DzTj.CdDz.Kh][DzTj.CdDz.Dzh] = DzTj;
        }
        
	}
}

function setDzInfo(xmlDzInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlDzInfo);
    
	var DzInfos = XmlDoc.getElementsByTagName("ITEM");
	for(var i = 0; i < DzInfos.length; i++)
	{
	    var DzInfo = new GJSB_DZ_INFO();
	    
	    DzInfo.DzPos.MkHh = parseInt(DzInfos[i].getAttribute("MKHH"));
	    DzInfo.DzPos.MkLh = parseInt(DzInfos[i].getAttribute("MKLH"));
	    DzInfo.DzPos.Row = parseInt(DzInfos[i].getAttribute("ROW"));
	    DzInfo.DzPos.Line = parseInt(DzInfos[i].getAttribute("LINE"));
        DzInfo.State = parseInt(DzInfos[i].getAttribute("STATE"));
        DzInfo.Bz = DzInfos[i].getAttribute("BZ");
        DzInfo.Dz.Kh = DzInfos[i].getAttribute("KH");		
        DzInfo.Dz.Dzh = DzInfos[i].getAttribute("DZH");		
   
   		//建"框号/端子"号到端子信息的索引
        if(this.listDzInfo[DzInfo.Dz.Kh] == null)
        {
            this.listDzInfo[DzInfo.Dz.Kh] = new Array();
        }
	    this.listDzInfo[DzInfo.Dz.Kh][DzInfo.Dz.Dzh] = DzInfo;
	    //建"模块行号/模块列号/端子行号/端子列号"到端子信息的索引
	    if(this.listDzInfoSortByPos[DzInfo.DzPos.MkHh] == null)
	    {
	    	this.listDzInfoSortByPos[DzInfo.DzPos.MkHh] = new Array();
	    }
	    if(this.listDzInfoSortByPos[DzInfo.DzPos.MkHh][DzInfo.DzPos.MkLh] == null)
	    {
	    	this.listDzInfoSortByPos[DzInfo.DzPos.MkHh][DzInfo.DzPos.MkLh] = new Array();
	    }
	    if(this.listDzInfoSortByPos[DzInfo.DzPos.MkHh][DzInfo.DzPos.MkLh][DzInfo.DzPos.Row] == null)
	    {
	    	this.listDzInfoSortByPos[DzInfo.DzPos.MkHh][DzInfo.DzPos.MkLh][DzInfo.DzPos.Row] = new Array();
	    }
	    this.listDzInfoSortByPos[DzInfo.DzPos.MkHh][DzInfo.DzPos.MkLh][DzInfo.DzPos.Row][DzInfo.DzPos.Line] = DzInfo;
	}
}

//没有成端信息返回NULL,返回类型为Array(SB_DZ_ZT)
function getDzInfo(kh, dzh)
{
    //如果对应的数组不存在
    if(this.listDzInfo[kh] == null)
    {
        return;
    }
    return this.listDzInfo[kh][dzh];
}


//没有成端信息返回NULL,返回类型为Array(SB_DZ_CD)
function getDzGlCdInfo(kh, dzh)
{
    //如果对应的数组不存在
    if(this.listCdInfo[kh] == null)
    {
        return;
    }
    //如果对应数组中的值不存在
    var DzCd = this.listCdInfo[kh][dzh];
    //如果没有成端信息
    if(DzCd == null)
    {
        return null;
    }
    
    var dzCdInfos = new Array();
    dzCdInfos.push(DzCd);
    //如果不止一个成端信息

    var DzCd2 = this.listCdInfo2[kh];

    if(DzCd2 != null)
    {
        DzCd2 = this.listCdInfo2[kh][dzh];
    }

    if(DzCd2 != null)
    {
        dzCdInfos.push(DzCd2);
    }
    return dzCdInfos;
}
//没有跳接信息返回NULL,返回类型为SB_DZ_JUMP
function getDzGlTjInfo(kh, dzh)
{
    //如果对应的数组不存在
    if(this.listTjInfo[kh] == null)
    {
        return;
    }
    return this.listTjInfo[kh][dzh];
}
//没有局向光纤信息返回NULL,返回类型为Array(SB_DZ_JXGQ)
function getDzGlJxgqInfo(kh, dzh)
{
    //如果对应的数组不存在
    if(this.listJxgqInfo[kh] == null)
    {
        return;
    }
    var DzJxgq = this.listJxgqInfo[kh][dzh];
    //如果没有关联局向光纤信息

    if(DzJxgq == null)
    {
        return null;
    }
    
    var dzJxgqInfos = new Array();
    dzJxgqInfos.push(DzJxgq);
    //如果关联不止一个局向光纤信息

    var DzJxgq2 = this.listJxgqInfo2[kh];
    if(DzJxgq2 != null)
    {
        DzJxgq2 = this.listJxgqInfo2[kh][dzh];
    }
    if(DzJxgq2 != null)
    {
        dzJxgqInfos.push(DzJxgq2);
    }
    return dzJxgqInfos;

}
//没有光路信息返回NULL,返回类型为SB_DZ_GR
function getDzGlGrInfo(kh, dzh)
{
    //如果对应的数组不存在
    if(this.listGrInfo[kh] == null)
    {
        return;
    }
    return this.listGrInfo[kh][dzh];
}

function GetDzInfoByPos(GjsbDzPos)
{
	if(this.listDzInfoSortByPos[GjsbDzPos.MkHh] == null)
    {
    	return null;
    }
    if(this.listDzInfoSortByPos[GjsbDzPos.MkHh][GjsbDzPos.MkLh] == null)
    {
    	return null;
    }
    if(this.listDzInfoSortByPos[GjsbDzPos.MkHh][GjsbDzPos.MkLh][GjsbDzPos.Row] == null)
    {
    	return null;
    }
    return this.listDzInfoSortByPos[GjsbDzPos.MkHh][GjsbDzPos.MkLh][GjsbDzPos.Row][GjsbDzPos.Line];

}

///////////////////////////////////////////////////////////
// ODF面板相关
//////////////////////////////////////////////////////////
function GetOdmHls(OdmInfo)
{
    var         iOdmDzhs = 1;
    var         iOdmDzls = 1;
	var         iMdyhs = 1;
	var         iMdyls = 1;
	var         iMbhs = 1;
	var         iMbls = 1;
	    
    if ((OdmInfo.iDys == 0) || (OdmInfo.iMdybs == 0) || (OdmInfo.iMbdzs == 0))
	{
		iOdmDzhs = 0;
		iOdmDzls = 0;
	}
	if ((OdmInfo.Dyplfs == enumPORT_LAY_UPTODOWN) || (OdmInfo.Dyplfs == enumPORT_LAY_DOWNTOUP))
	{
		iOdmDzhs = iOdmDzhs*OdmInfo.iDys;
	}
	else
	{
		iOdmDzls = iOdmDzls*OdmInfo.iDys;
	}
	if ((OdmInfo.Bplfs == enumPORT_LAY_UPTODOWN) || (OdmInfo.Bplfs == enumPORT_LAY_DOWNTOUP))
	{
		iOdmDzhs = iOdmDzhs*OdmInfo.iMdybs;
		iMdyhs = iMdyhs*OdmInfo.iMdybs;
	}
	else
	{
		iOdmDzls = iOdmDzls*OdmInfo.iMdybs;
		iMdyls = iMdyls*OdmInfo.iMdybs;
	}
	if ((OdmInfo.Dzplfs == enumPORT_LAY_UPTODOWN) || (OdmInfo.Dzplfs == enumPORT_LAY_DOWNTOUP))
	{
		iOdmDzhs = iOdmDzhs*OdmInfo.iMbdzs;
		iMdyhs = iMdyhs*OdmInfo.iMbdzs;
		iMbhs = iMbhs*OdmInfo.iMbdzs;
	}
	else
	{
		iOdmDzls = iOdmDzls*OdmInfo.iMbdzs;
		iMdyls = iMdyls*OdmInfo.iMbdzs;
		iMbls = iMbls*OdmInfo.iMbdzs;
	}	
    return[iOdmDzhs, iOdmDzls, iMdyhs, iMdyls, iMbhs, iMbls];
}

function setOdfMbInfo(xmlOdfMbInfo)
{
    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlOdfMbInfo);
    
	var OdfInfos = XmlDoc.getElementsByTagName("ODFINFO");
	
	this.OdfDzMbInfo.LMks = parseInt(OdfInfos[0].getAttribute("LMKS"));           //块数
	this.OdfDzMbInfo.KPlfs = parseInt(OdfInfos[0].getAttribute("KPLFS"));       //块排列方式

	var OmdInfos = XmlDoc.getElementsByTagName("ODMINFO");
	var ListOdmInfo = new Array();
	for(var i = 0; i < OmdInfos.length; i++)
	{
	    var Odm = new ODM_INFO();
	    var         Temp;
	    
        Odm.EntityNo = parseInt(OmdInfos[i].getAttribute("ENTITYNO"));
        Odm.WlKh = parseInt(OmdInfos[i].getAttribute("WLKH"));		
        Odm.Kh = OmdInfos[i].getAttribute("KH");		
        Odm.iDys = parseInt(OmdInfos[i].getAttribute("DYS"));
        Odm.iMdybs = parseInt(OmdInfos[i].getAttribute("MDYBS"));
        Odm.iMbdzs = parseInt(OmdInfos[i].getAttribute("MBDZS"));
        Odm.Dyplfs = OmdInfos[i].getAttribute("DYPLFS");
        Odm.Bplfs =  OmdInfos[i].getAttribute("BPLFS");
        Odm.Dzplfs = OmdInfos[i].getAttribute("DZPLFS");
	    Odm.Bz = OmdInfos[i].getAttribute("BZ");	
	
	    ListOdmInfo.push(Odm);
	    Temp = this.GetOdmHls(Odm);
	    iOdmDzhs = Temp[0];
	    iOdmDzls = Temp[1];
	    if (iOdmDzhs > this.m_iMaxRowPerBlock)
	    {
	        this.m_iMaxRowPerBlock = iOdmDzhs;
	    }
	    if (iOdmDzls > this.m_iMaxLinePerBlock)
	    {
	        this.m_iMaxLinePerBlock = iOdmDzls;
	    }
	}
	
	this.OdfDzMbInfo.listOdmInfo = ListOdmInfo;
}

function GetOdmByWlkh(iWlkh)
{
	var curOdm = null;
	for(var i = 0; i < this.OdfDzMbInfo.listOdmInfo.length; i++)
	{
		curOdm = this.OdfDzMbInfo.listOdmInfo[i];
		if(curOdm.WlKh == iWlkh)
		{
			return curOdm;
		}
	}
}
///////////////////////////////////////////////////////////
// 光交设备面板相关
//////////////////////////////////////////////////////////
function setGjsbMbInfo(xmlGjsbMbInfo)
{

    var XmlDoc = getXmlDoc();
    XmlDoc.loadXML(xmlGjsbMbInfo);
    
	var GjsbInfos = XmlDoc.getElementsByTagName("GJSBINFO");
	
	this.GjsbDzMbInfo.Ls = parseInt(GjsbInfos[0].getAttribute("LS"));           //列数
	this.GjsbDzMbInfo.LMks = parseInt(GjsbInfos[0].getAttribute("LMKS"));       //块数
	this.GjsbDzMbInfo.LPlfsLs = GjsbInfos[0].getAttribute("LPLFS");   //列排列方式
	this.GjsbDzMbInfo.KPlf = GjsbInfos[0].getAttribute("KPLFS");       //块排列方式
	
	var DzbInfos = XmlDoc.getElementsByTagName("DZBINFO");
	var ListDzbInfo = new Array();
	for(var i = 0; i < DzbInfos.length; i++)
	{
	    var DzBlock = new GJSBDZ_BLOCK();
	    
        DzBlock.EntityNo = parseInt(DzbInfos[i].getAttribute("ENTITYNO"));
        DzBlock.MkLh = parseInt(DzbInfos[i].getAttribute("MKLH"));		
        DzBlock.MkHh = parseInt(DzbInfos[i].getAttribute("MKHH"));		
        DzBlock.RowPerBlock = parseInt(DzbInfos[i].getAttribute("ROWPERBLOCK"));
        DzBlock.LinePerBlock = parseInt(DzbInfos[i].getAttribute("LINEPERBLOCK"));
        DzBlock.Dzhplfs = parseInt(DzbInfos[i].getAttribute("DZHPLFS"));
        DzBlock.Dzlplfs = parseInt(DzbInfos[i].getAttribute("DZLPLFS"));
        DzBlock.RowFirst = parseInt(DzbInfos[i].getAttribute("ROWFIRST"));
	    ListDzbInfo.push(DzBlock);
	    if (DzBlock.RowPerBlock > this.m_iMaxRowPerBlock)
	    {
	        this.m_iMaxRowPerBlock = DzBlock.RowPerBlock;
	    }
	    if (DzBlock.LinePerBlock > this.m_iMaxLinePerBlock)
	    {
	        this.m_iMaxLinePerBlock = DzBlock.LinePerBlock;
	    }
	}
	
	this.GjsbDzMbInfo.listDzb = ListDzbInfo;
}

function GetBlockByMkHhLh(iMkHh, iMkLh)
{
	var curBlock = null;
	for(var i = 0; i < this.GjsbDzMbInfo.listDzb.length; i++)
	{
		curBlock = this.GjsbDzMbInfo.listDzb[i];
		if(curBlock.MkHh == iMkHh && curBlock.MkLh == iMkLh)
		{
			return curBlock;
		}
	}
}

function getXmlDoc()
{
	var obj = null;
	try
	{
		obj = new ActiveXObject("Msxml2.DOMDocument.4.0");
		return obj;
	}
	catch(e)
	{
		try
		{
			obj = new ActiveXObject("Microsoft.XMLDOM");
			return obj;
		}
		catch(o)
		{
			obj = null;
		}
	}
	return null;
}

function GetMaxRowPerBlock()
{
    return this.m_iMaxRowPerBlock;
}

function GetMaxLinePerBlock()
{
    return this.m_iMaxLinePerBlock;
}
